﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace CustomWindows.Window_API
{
    class WindowState:WindowsFunction
    {
        /// <summary>
        /// The Windows State
        /// </summary>
        public enum ScreenState
        {
            Close = 0,
            Normal = 1,
            Minimize = 2,
            Maximize = 3,
        }

        private ScreenState _state;

        public WindowState(IntPtr hwnd, ScreenState state)
            : base(hwnd)
        {
            _state = state;
        }


        public override void UpdateFunction()
        {
            ShowWindow(Hwnd, (int)_state);
        }

        #region API

        [DllImport("User32.dll")]
        public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr childe, string strclass, string strname);
        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);

        #endregion

    }
}
